<?php

class CreateSched extends Model{
	
	function CreateSched(){
		parent::Model();
	}
	
	function insert($details){
		$this->db->insert("schedule", $details);
	}
	
	function maketeach($teacherid, $subjectid){
		$details = array(
		                 "teacherid" => $teacherid,
		                 "subjectid" => $subjectid
		                );
		$this->db->where("subjectid", $subjectid);
		$this->db->where("teacherid", $teacherid);
		$this->db->from("subjectstaught");
		$count = $this->db->count_all_results();
		if($count == 0){
			$this->db->insert("subjectstaught", $details);
		} else{
		}
	}
}

?>
